#include <stdio.h>
/*
 * Just for a test.
 */

int func(x) {
	int countx = 0;
	
	while(x) {
		countx++; 
		x = x & (x -1); //change 1 to 0, so countx is the x's count 1
	}
	
	return countx;
}

int main() {
	int input_number, result;

	input_number = 9999; // 9999 <=> 111111011
	result = func(input_number);  

	printf("The result=%d\n", result);

	return 0;
}
